package com.itgaoshu.hospitalproject.mapper;

import com.itgaoshu.hospitalproject.bean.Area;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface AreaMapper {
    /**
     * @param area
     * @return
     */



    //查询药品产地的方法
    List<Area> findAllArea(Area area);

    //添加产地的方法
    @Insert("insert into area values(null,#{areaName})")
    int addArea(Area area);

    //根据添加产地查询数据库中是否存在
    @Select("select count(1) from area where areaname=#{areaName}")
    int count(Area area);

    //删除产地的方法
    @Delete("delete from eara where areaid=#{areaId}")
    int deleteArea(int areaId);
}
